package powtorka.serializacja;

import java.text.NumberFormat;

public class StingPomiar {

	public static void main(String[] args) {

		int max = 10000;
		long w1, w2;
		String s = "a";
		System.out.println(s);
		long start = System.nanoTime();
		for (int i = 0; i < max; i++) {
			s += "a";
		}
		w1 = System.nanoTime() - start;
		System.out.println(NumberFormat.getIntegerInstance().format(w1));
		
		String b = "a";
		System.out.println("\nStart\n");
		start = System.nanoTime();
		StringBuffer sb = new StringBuffer(b);
		for (int i = 0; i < max; i++) {
			sb.append("a");
		}
		
		w2 = System.nanoTime() - start;
		System.out.println(NumberFormat.getIntegerInstance().format(w2));
		
		System.out.println("\n" + (w1 / w2));
	}

}
